<?php 

include_once 'regsettings.php';

// ----------------------------- Field Spec settings are as below:	
//$fieldspec['<column>'] ['show'] = {'0' = notshown, '1' = show readonly, 'L' = show, use list (manual join), E = editable;
//$fieldspec['<column>'] ['key'] = {1 = key field, 0 of not (or dont include)};
//$fieldspec['<column>'] ['select'] = {'T' = text, 'D' = dropdown select, 'C' = checkbox (for 1 or 0 boolean), 'R' = radiogroup, 'A' = textarea, 'DT' = calendar for date-time};
//$fieldspec['<column>'] ['filter'] = {1 if value is filtered for, 0 or undefined if not};	
//$fieldspec['<column>'] ['add'] = {1 = include value as input in add box, 0 or undefined = do not };
//$fieldspec['<column>'] ['size'] = size of input field, or columns (cols) for textarea;
//$fieldspec['<column>'] ['rows'] = rows of textarea or listbox (future);
//$fieldspec['<column>'] ['headname'] = {Name to show on column heading or input heading};
//$fieldspec['<column>'] ['keyvalue'] = {array column to use for key in drop-down lists} ;
//For lists, Not needed if columns 'keyvalue' and 'showvalue' are used in array, no need to define these specs;
//$fieldspec['<column>'] ['showvalue'] = {array column to use for shown value in drop-down lists};
//$fieldspec['<column>'] ['rawformat']	= additional html to include inside the input field;
//$fieldspec['<column>'] ['image']	= image file name of image to associate with control (implemetned for calendar);
//$fieldspec['<column>'] ['showdateformat'] = format string for inital display of shown date, using php date formatters;
//$fieldspec['<column>'] ['cal'] ['ifFormat'] = format string of date from database (or whatever) for input to calendar, js date formatters;
//$fieldspec['<column>'] ['cal'] ['align'] = {'T1' Shows calendar above imput control (default), 'B1' shows it below controls};
//$fieldspec['<column>'] ['cal'] ['showsTime'] = {true = show time in calendar below date, false (Default) = show and use calendar for dates only};
//$fieldspec['<column>'] ['cal'] ['singleClick'] = {true = (Default) open calendar with single click, false = double click for calendar};
//$fieldspec['<column>'] ['allowhtml'] = {true:  do not escape html (to allow images, etc), false (or unset by default) escapes using htmlspecialchars)};
//$fieldspec['<column>']['source'] = table name for source table, will be appended to filters to resolve ambiguies with multiple tables


//---Note - for autoheadings, rows will be arranged in the order of these definition secitons for each column
	
if(($PAGETYPE == 'LIST') OR ($PAGETYPE == 'FORM') ){
$array_user_id_list = get_array_query("SELECT role_id AS keyval, role_name AS showval FROM " . REG_ROLE_TABLE);
$array_page_list = get_array_query("SELECT page_name AS keyval, page_name AS showval FROM " . REG_PAGES_TABLE);
}

//column settings for role_id
$fieldspec['role_id'] ['show'] = 'E';
$fieldspec['role_id'] ['key'] = 1;
$fieldspec['role_id'] ['add'] = 1;
$fieldspec['role_id'] ['select'] = 'D';
$fieldspec['role_id'] ['list'] = $array_user_id_list;
$fieldspec['role_id'] ['keyvalue'] = 'keyval';
$fieldspec['role_id'] ['showvalue'] = 'showval';
$fieldspec['role_id'] ['headname'] = 'Role';
$fieldspec['role_id'] ['filter'] = 1;
$fieldspec['role_id'] ['showfilter'] = 1;
$fieldspec['role_id'] ['size'] = 20;
$fieldspec['role_id'] ['rows'] = 1;

//column settings for page_name
$fieldspec['page_name'] ['show'] = 'E';
$fieldspec['page_name'] ['key'] = 1;
$fieldspec['page_name'] ['add'] = 1;
$fieldspec['page_name'] ['headname'] = 'Page';
$fieldspec['page_name'] ['select'] = 'D';
$fieldspec['page_name'] ['list'] = $array_page_list;
$fieldspec['page_name'] ['keyvalue'] = 'keyval';
$fieldspec['page_name'] ['showvalue'] = 'showval';
$fieldspec['page_name'] ['filter'] = 1;
$fieldspec['page_name'] ['showfilter'] = 1;
$fieldspec['page_name'] ['size'] = 60;
$fieldspec['page_name'] ['rows'] = 1;

//column settings for permission
$fieldspec['permission'] ['show'] = 'E';
$fieldspec['permission'] ['headname'] = 'Permission';
$fieldspec['permission'] ['select'] = 'T';
$fieldspec['permission'] ['size'] = 10;
$fieldspec['permission'] ['rows'] = 1;

?>